package com.zhudeshuai.zhudemolist.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.zhudeshuai.zhudemolist.MainActivity;
import com.zhudeshuai.zhudemolist.R;
import com.zhudeshuai.zhudemolist.adapter.MyViewHolder1;

/**
 * 实现两个listview联动效果
 *
 * @author zhudeshuai
 * @since 16/8/10
 */
public class TwoListActivity extends Activity {

    private SwipeRefreshLayout sf1;
    private SwipeRefreshLayout sf2;

    private RecyclerView mRecyclerView1;
    private RecyclerView mRecyclerView2;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_two_list);

        mRecyclerView1 = (RecyclerView) findViewById(R.id.recyclerView1);
        mRecyclerView2 = (RecyclerView) findViewById(R.id.recyclerView2);

        mRecyclerView1.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerView2.setLayoutManager(new LinearLayoutManager(this));

        mRecyclerView1.setAdapter(new MyViewHolder1.MyAdapter1(this));
        mRecyclerView2.setAdapter(new MyViewHolder1.MyAdapter1(this));
    }

    public static void open(MainActivity mainActivity) {
        mainActivity.startActivity(new Intent(mainActivity, TwoListActivity.class));
    }
}
